package com.example.gemfire.base;

import com.example.gemfire.domain.BalanceTransfer;
import com.example.gemfire.repository.BalanceTransferRepository;
import com.example.gemfire.repository.CardRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/base")
public class BaseController {

    @Autowired
    private BalanceTransferRepository balanceTransferRepository;

    @Autowired
    private CardRepository cardRepository;

    @DeleteMapping("/allCache")
    public HttpEntity<Object> deleteAll() {
        balanceTransferRepository.deleteAll();
        cardRepository.deleteAll();
        return new ResponseEntity<>(null, HttpStatus.NO_CONTENT);
    }
}
